package com.yangjun.controller.report;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.yangjun.service.report.DownLoadService;

@RestController
@RequestMapping(value="/excel/download")
public class DownloadReportController {
	@Autowired
	private DownLoadService downLoadService;
	
	@ResponseBody
	@RequestMapping("/list")
	public Object queryDownloadList(@RequestParam(value="userid")String userid){
		return downLoadService.queryDownloadList(userid);
	}
	@RequestMapping("/downloadReport")
	public Object downloadReport(@RequestParam(value="reportName")String reportName,@RequestParam(value="fileName")String fileName,HttpServletResponse response){
		return downLoadService.downloadReport(reportName,fileName,response);
	}
	
	@RequestMapping("/deleteAll")
	public Object deleteAll(@RequestParam(value="userid")String userid){
		return downLoadService.deleteAll(userid);
	}
}
